package com.qiang.test01;

import java.io.*;

public class Demo10 {
    public static void main(String[] args) throws IOException {
        //创建file对象
        File f1 = new File("D:\\hh\\t.txt");

        //创建Stream流对象
        FileOutputStream fs = new FileOutputStream("D:\\hh\\t.txt");
        byte[] b = {97, 98, 99};
        fs.write(b);

        //创建复制对象
        FileOutputStream fs3 = new FileOutputStream("D:\\kk\\h.txt");

        //创建读取对象
        FileInputStream fs2 = new FileInputStream("D:\\hh\\t.txt");
        int read = fs2.read();
        while (read != -1) {
            fs3.write(read);
            read = fs2.read();
        }
        fs.close();
        fs2.close();
        fs3.close();
    }
}
